package com.wondream.myframework.app.common.util;

import java.util.*;

public class MapUtil {

    public static List<Map.Entry<String, String>> sortKeys(Map<String, String> sourceMap){
        List<Map.Entry<String, String>> infoIds = new ArrayList<Map.Entry<String, String>>(sourceMap.entrySet());
        // 对HashMap中的key 进行排序
        Collections.sort(infoIds, new Comparator<Map.Entry<String, String>>() {
            public int compare(Map.Entry<String, String> o1,
                               Map.Entry<String, String> o2) {
                return (o1.getKey()).toString().compareTo(o2.getKey().toString());
            }
        });
        return infoIds;
    }

}
